package com.zhixi.pattern.important.singletonpattern.operation;

/**
 * 静态内部类
 *
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/15 9:33
 */
public class Singleton7 {

    private Singleton7() {}

    private static class SingletonInstance {
        private static final Singleton7 INSTANCE = new Singleton7();
    }

    // 双重检查
    public static synchronized Singleton7 getInstance() {
        return SingletonInstance.INSTANCE;
    }

}
